package com.java.java8.util.functioninterfacedemo;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @author liyanhao
 * @Date 2023-03-26 19:18
 */
@FunctionalInterface
public interface Predicate<T> {
    boolean test(T t);
}

class testPredicate {

    public static void main(String[] args) {
        List<String> provinces = new ArrayList<>(Arrays.asList("Guangdong", "Jiangsu", "Guangxi", "Jiangxi", "Shandong"));
        boolean g = provinces.removeIf(s -> {
            return s.startsWith("G");
        });
        System.out.println(g);
        System.out.println(provinces);
    }
}
